<!-- 零件类别设置 -->
<template>
  <div id="dialog-container">
    <el-button type="text" @click="dialogVisible = true">零件类别设置</el-button>
    <el-dialog v-dialogDrag title="零件类别设置" :fullscreen="isFullScreen" :custom-class="isFullScreen?'fullscreen-default-dialog':'vertical-center-dialog'" append-to-body :visible.sync="dialogVisible" width="700px" :close-on-click-modal="false">
      <button type="button" aria-label="fullScreen" class="el-dialog__headerbtn" style="margin-right:25px;top:" @click="isFullScreen = !isFullScreen">
                                                                                                  <i class="el-dialog__close iconfont icon-fuzhicopy22"></i>
                                                                                                </button>
      <el-form :model="form" :inline="true" label-width="110px" size="small">
        <el-form-item label="零件类别名称：">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="零件号：">
          <el-input v-model="form.name" style="width: 145px;"></el-input>
          <part-number-button style="display: inline-block;"></part-number-button>
        </el-form-item>
      </el-form>
      <el-button type="primary" plain size="small">添加</el-button>
      <el-table :data="tableData" size="small">
        <el-table-column type="selection" width="50"></el-table-column>
        <el-table-column type="index" align="center" label="序号" width="50"></el-table-column>
        <el-table-column prop="date" align="center" label="零件类别名称" min-width="100"></el-table-column>
        <el-table-column prop="date" align="center" label="零件号" min-width="100"></el-table-column>
        <el-table-column prop="address" align="center" label="操作" min-width="100">
        <template slot-scope="scope">
            <el-button type="text">修改</el-button>
            <el-button type="text">删除</el-button>
        </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import PartNumber from '../part-number-button';
  export default {
    components: {
        'part-number-button': PartNumber
    },
    data() {
      return {
        dialogVisible: false,
        isFullScreen: false,
        form: {
          name: ''
        },
        tableData: [{
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1519 弄'
        }, {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1516 弄'
        }]
      }
    }
  }
</script>
